/*Problem Id:1005  User Id:team01 
Memory:24K  Time:31MS
Language:C++  Result:Accepted


	problem name: Zipper

	source : Pacific Northwest 2004
	problem type: 动态规划 || 递归搜索
	
	date : 2005.4.23 北师大校内比赛


*/
#include <stdio.h>
#include <string.h>
#include <math.h>
	char s1[1000],s2[1000];
	char to[2000];


	int len1,len2,len3;
	int flag;

	int n;

int check(int pt1,int pt2,int pt3)
{
	if (pt3==len3 && pt2==len2 && pt1==len1) return 1;
	if (s1[pt1]==s2[pt2] && to[pt3]==s1[pt1])
	{
		if (check(pt1+1,pt2,pt3+1)) return 1;
		if (check(pt1,pt2+1,pt3+1)) return 1;
		return 0;
	}
	else
	{
		if (to[pt3]==s1[pt1] && pt1<len1)
		{
			return check(pt1+1,pt2,pt3+1);
		}
		else if (to[pt3]==s2[pt2] && pt2<len2)
		{
			return check(pt1,pt2+1,pt3+1);
		}
		else
		{
			return 0;
		}
	}
}

int precheck()
{
	int ch1[200];
	int ch2[200];
	int i,j;
	memset(ch1,0,sizeof(ch1));
	memset(ch2,0,sizeof(ch2));
	for (i=0;i<len1;i++)
		ch1[s1[i]]++;
	for (i=0;i<len2;i++)
		ch1[s2[i]]++;
	for (i=0;i<len3;i++)
		ch2[to[i]]++;
	for (i=0;i<200;i++)
		if (ch1[i]!=ch2[i]) return 0;
	return 1;
}


main()
{
	int i, j;


	scanf("%d", &n);
	for (i=1;i<=n;i++)
	{
		scanf("%s",s1);
		scanf("%s",s2);
		scanf("%s",to);
		len1=strlen(s1);
		len2=strlen(s2);
		len3=strlen(to);
		flag=1;
		if (len1+len2!=len3 ) flag=0;
		if (flag==1)
			if (s1[len1-1]!=to[len3-1] && s2[len2-1]!=to[len3-1]) flag=1;
		if (flag==1) flag=precheck();
		if (flag==1) flag=check(0,0,0);
		printf("Data set %d: ",i);
		if (flag) printf("yes\n");
		else printf("no\n");

	}



	return 0;
}
/*
测试数据
aaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
*/

